
package DB_Layer;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import Model_Layer.*;

public class DB_SupplierTest {
	private DB_Supplier dbSupObj;

	@Before
	public void setUp() throws Exception {
		dbSupObj = new DB_Supplier();
	}

	@Test
	public void testInsertSupplier() {
		Supplier newTestSup = new Supplier();
		
		// setting up the new supplier for test
		// name, address, email, zipcode, phoneno, city, country
		// cusID will be set up in DB_Supplier
		newTestSup.setSupID(0);
		newTestSup.setName("test supplier");
		newTestSup.setAddress("Test supplier gade 1");
		newTestSup.setEmail("testsupplier@testsupplier.dk");
		newTestSup.setZipCode(1234);
		newTestSup.setPhoneNo("123456789");
		newTestSup.setCity("test supplier city");
		newTestSup.setCountry("test supplier country");
		
		if(newTestSup != null) {
			try {
				dbSupObj.insertSupplier(newTestSup);
			}
			catch(Exception e) {
				e.printStackTrace();
			}
		}
		else {
			System.out.println("Customer was not created!");
		}
	}
}
